package com.azzan.springcloud2021.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author Azzan
 * @data 2021/7/22 10:16
 */
@Configuration
public class ApplicationContextConfig {


    @Bean
    @LoadBalanced  //赋予RestTemplate负载均衡能力
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
